package mylibrary.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class Test {

	public static void main(String[] args) {
		
		try {
			Class.forName("com.mysql.jdbc.Driver");
			
			Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/qiyexuexi", "root", "mysql");
			
			Statement st = conn.createStatement();
			//st.setMaxRows(1);
			
			//conn.setAutoCommit(false);
			//st.setFetchSize(50);
			
			ResultSet rs = st.executeQuery("select * from tbl_user_access_info");
			
			int i = 0;
			while(rs.next()) {
				String sessionId = rs.getString(1);
				System.out.println(sessionId);
				i++;
			}
			
			System.out.println(i);
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		
		
		
		
	}
}
